#ifndef CBATTLE_H_INCLUDED
#define CBATTLE_H_INCLUDED

#include "LON.h"

class CMinionNode;
class COverlord;
class CStateGame;
struct MinionStat;

class CBattle
{
  public:
    CBattle();
    ~CBattle();

    //! Update Delay of Minion
    void updateDelay(CMinionNode *target, u16 delay);

    //! This should be called when the game started
    void gameStart();

    //! Methods to check for victory conditions
    //! \return Player number of the winner. -1 for no winner
    s32 victoryCheck();

    //! TODO: Overlord spell
    void castSpell();

    //! Add a minion into battlefield
    CMinionNode * addMinion(CStateGame *state, MinionStat &stat, u32 player);

    //! Remove a minion from battlefield
    void removeMinion(CMinionNode * minion);

    //! Finds and returns a minion based on it's Scene Node
    CMinionNode * getMinion(ISceneNode * node);

    //! Finds and returns a minion based on it's ID
    CMinionNode * getMinionFromID(u32 id);

    //! NOTE: Non-functional & Unused getter
    COverlord * getPlayer();

    //! Add a player to the battle
    void addPlayer(COverlord *player);

    //! Returns the minion list
    vector <CMinionNode*> &getMinionList();

    //! Returns the first minion on the delay lists
    CMinionNode * getFirstMinion();

  private:
    vector <CMinionNode*> vMinion;

    vector <CMinionNode*> vMinionDead;

    u32 minionCount;

    vector <COverlord*> vPlayers;
};

#endif // CBATTLE_H
